import { DEFAULT_LAYOUT } from '../base'
import { AppRouteRecordRaw } from '../types'
const Mall: AppRouteRecordRaw = {
  path: '/mall',
  name: 'mall',
  component: DEFAULT_LAYOUT,
  meta: {
    locale: '商城',
    icon: 'icon-common',
    requiresAuth: true,
    order: 8,
  },
  children: [
    {
      path: '/mall/product',
      name: 'mallProduct',
      component: () => import('@/views/mall/product/index.vue'),
      meta: {
        locale: '商品管理',
        requiresAuth: true,
        order: 3,
      },
      children: [
        {
          path: '/mall/product/list',
          name: 'productList',
          component: () => import('@/views/mall/product/list.vue'),
          meta: {
            locale: '商品列表',
            requiresAuth: true,
            roles: ['*'],
          },
        },

        {
          path: '/mall/product/classify',
          name: 'productClassify',
          component: () => import('@/views/mall/product/classify.vue'),
          meta: {
            locale: '分类管理',
            requiresAuth: true,
            roles: ['*'],
          },
        },

        {
          path: '/mall/product/transport',
          name: 'productTransport',
          component: () => import('@/views/mall/product/transport.vue'),
          meta: {
            locale: '运费模板',
            requiresAuth: true,
            roles: ['*'],
          },
        },
      ],
    },
    {
      path: '/mall/order',
      name: 'mallOrder',
      component: () => import('@/views/mall/order/index.vue'),
      meta: {
        locale: '订单管理',
        requiresAuth: true,
        order: 8,
      },
      children: [
        {
          path: '/mall/order/list',
          name: 'orderList',
          component: () => import('@/views/mall/order/list.vue'),
          meta: {
            locale: '订单列表',
            requiresAuth: true,
            roles: ['*'],
          },
        },

        {
          path: '/mall/order/afterSales',
          name: 'orderAfterSales',
          component: () => import('@/views/mall/order/afterSales.vue'),
          meta: {
            locale: '售后订单',
            requiresAuth: true,
            roles: ['*'],
          },
        },
      ],
    },
  ],
}

export default Mall
